# -*- coding: utf-8 -*-
# @Time    : 2022/01/05 16:20
# @Author  : ldh

import os
import sys
import io
# Change default encoding to utf8
from basic.UIParent import UIParent
from basic.data import global_var
from basic.utils.runnerInit import CaseRunner

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8')

from basic.utils.Email import sendEmail
from basic.utils.path import Path
from test.cases.agx.AGXDataSecretary import AGXDataSecretary
from test.cases.agx.AGXDigitalCard import AGXDigitalCard
from test.cases.agx.AGXIndex import AGXIndex
from test.cases.agx.AGXMyInfo import AGXMyInfo
from test.cases.agx.AGXSearch import AGXSearch
from test.cases.agx.AGX_oclife import AGX_oclife
from test.cases.agx.AGX_trends import AGX_trends
from BeautifulReport import BeautifulReport as bf

current_directory = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.dirname(current_directory) + os.path.sep + ".")
sys.path.append(root_path)


if __name__ == '__main__':
   """
   调试通过的测试用例集合
   """

   classNameList = [AGXIndex,AGXSearch,AGXMyInfo,AGXDigitalCard,AGXDataSecretary,AGX_oclife,AGX_trends]

   suite = CaseRunner.runCases(classNameList)
   run = bf(suite)  # 实例化BeautifulReport模块
   run.report(filename='test', report_dir=Path.getProjectPath()+"/res/report", description='爱广西UI自动化测试用例')
   sendEmail("爱广西UI自动化测试", CaseRunner.caseResult(run, 0), 0)
